package com.day.mapper;

import com.day.pojo.Classes;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface ClassesMapper {

    List<Classes> getClassesList();

    @Select("select * from classes where c_id = #{c_id};")
    Classes getClassesById(Integer c_id);

    @Insert("insert into classes values (0,#{c_name})")
    void addClasses(Classes classes);
    
    @Delete("delete from classes where c_id=#{c_id};")
    void delClassesById(Integer c_id);
    
    @Update("update classes set c_name = #{c_name} where c_id = #{c_id};")
    void editClassesById(Classes classes);
}
